

**********
** TABLE 2
**********

foreach case in BG_EP GR_EP RO_EP ESP_EP UK_EP UK_GE {
di "Case = `case'"
import delimited "`case'.csv", clear case(preserve)
	* Valid obs., by treatment status
tab treat if pickone_voter == 1
	* Opt-in completed, by treatment status
tab treat if optin_completed == 1 & pickone_voter == 1
	* p(optin), by treatment status, and including chi-squared test
tab treat optin_completed if pickone_voter == 1, row chi2
}


	

**********
** TABLE 3
**********

foreach case in BG_EP GR_EP RO_EP ESP_EP UK_EP UK_GE {
di "Case = `case'"
import delimited "`case'.csv", clear case(preserve)
* Means of covariates by treatment status in opt-in sample
bysort treat: sum age2 if optin_completed == 1 & pickone_voter == 1
bysort treat: sum gender_female if optin_completed == 1 & pickone_voter == 1
bysort treat: sum degree if optin_completed == 1 & pickone_voter == 1
bysort treat: sum high_interest if optin_completed == 1 & pickone_voter == 1
bysort treat: sum selfPlace_LR if optin_completed == 1 & pickone_voter == 1
bysort treat: sum undecided if optin_completed == 1 & pickone_voter == 1
bysort treat: sum issue_voter if optin_completed == 1 & pickone_voter == 1
* Overall F-test
reg treat age2 gender_female degree high_interest selfPlace_LR undecided issue_voter if optin_completed == 1 & pickone_voter == 1
}



***********
** FIGURE 2
***********


* BG (EP)
import delimited "BG_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m1
test 1.treat#c.advice // coef. = 0.013; p = 0.0009
global model = "m1"
global xlabel = "-50(50)50"
global ylabel = "-.8(.4).8"
global title = "Bulgaria (EP)"
qui do "Conditional_Marginal_Effects.do"

* GR (EP)
import delimited "GR_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m2
test 1.treat#c.advice // coef. = 0.005; p = 0.0021
global model = "m2"
global xlabel = "-50(50)50"
global ylabel = "-.5(.25).5"
global title = "Greece (EP)"
qui do "Conditional_Marginal_Effects.do"

* RO (EP)
import delimited "RO_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m3
test 1.treat#c.advice // coef. = 0.007; p = 0.00004
global model = "m3"
global xlabel = "-50(50)50"
global ylabel = "-.5(.25).5"
global title = "Romania (EP)"
qui do "Conditional_Marginal_Effects.do"

* ESP (EP)
import delimited "ESP_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m4
test 1.treat#c.advice // coef. = 0.005; p < 0.000001
global model = "m4"
global xlabel = "-50(50)50"
global ylabel = "-.5(.25).5"
global title = "Spain (EP)"
qui do "Conditional_Marginal_Effects.do"

* UK (EP)
import delimited "UK_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m5
test 1.treat#c.advice // coef. = 0.003; p < 0.000001
global model = "m5"
global xlabel = "-100(50)100"
global ylabel = "-.5(.25).5"
global title = "UK (EP)"
qui do "Conditional_Marginal_Effects.do"

* UK (GE)
import delimited "UK_GE.csv", clear case(preserve)
reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
estimates store m6
test 1.treat#c.advice // coef. = 0.004; p < 0.000001
global model = "m6"
global xlabel = "-100(50)100"
global ylabel = "-.5(.25).5"
global title = "UK (GE)"
qui do "Conditional_Marginal_Effects.do"



**********
** TABLE 4
**********

foreach case in BG_EP GR_EP RO_EP ESP_EP UK_EP UK_GE {
import delimited "`case'.csv", clear case(preserve)
di "Case = `case'"
qui: reg ptv i.treat##c.advice if optin_completed == 1, cl(id)
sum ptv if e(sample) 
qui: local sd = r(sd)
qui: margins, dydx(treat) at(advice = (-100(25)100)) post
* Implied changes in terms of SD (%)
* 75
di _b[1.treat:8._at] / `sd' * 100
test _b[1.treat:8._at] = 0
* 50
di _b[1.treat:7._at] / `sd' * 100 
test _b[1.treat:7._at] = 0
* 25 
di _b[1.treat:6._at] / `sd' * 100 
test _b[1.treat:6._at] = 0
* 0
di _b[1.treat:5._at] / `sd' * 100
test _b[1.treat:5._at]  = 0
* 25
di _b[1.treat:4._at] / `sd' * 100
test _b[1.treat:4._at] = 0
* 50
di _b[1.treat:3._at] / `sd' * 100 
test _b[1.treat:3._at] = 0
* 75
di _b[1.treat:2._at] / `sd' * 100
test _b[1.treat:2._at] = 0
}



***********
** FIGURE 3
***********

** Education - p < 0.05
***********************

* BG (EP)
import delimited "BG_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.degree if optin_completed == 1, cl(id)
estimates store m1
global model = "m1"
global title = "Education - Bulgaria (EP)"
global x = "degree"
global xlow = "No degree"
global xhigh = "Degree"
global xlabel = "-50(50)50"
global marginright = "20"
qui do "Three_Way_Interactions.do"


** Political interest - p < 0.05
********************************

* GR (EP)
import delimited "GR_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.high_interest if optin_completed == 1, cl(id)
estimates store m2
global model = "m2"
global title = "Interest - Greece (EP)"
global x = "high_interest"
global xlow = "Low interest"
global xhigh = "High interest"
global xlabel = "-50(50)50"
global marginright = "22"
qui do "Three_Way_Interactions.do"
	
* UK (GE)
import delimited "UK_GE.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.high_interest if optin_completed == 1, cl(id)
estimates store m6
global model = "m6"
global title = "Interest - UK (GE)"
global x = "high_interest"
global xlow = "Low interest"
global xhigh = "High interest"
global xlabel = "-100(50)100"
global marginright = "22"
qui do "Three_Way_Interactions.do"


** Undecided - p < 0.05
***********************

* ESP (EP)
import delimited "ESP_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.undecided if optin_completed == 1, cl(id)
estimates store m4
global model = "m4"
global title = "Undecided - Spain (EP)"
global x = "undecided"
global xlow = "Decided"
global xhigh = "Undecided"
global xlabel = "-50(50)50"
global marginright = "22"
qui do "Three_Way_Interactions.do"

* UK (GE)
import delimited "UK_GE.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.undecided if optin_completed == 1, cl(id)
estimates store m6
global model = "m6"
global title = "Undecided -  UK (GE)"
global x = "undecided"
global xlow = "Decided"
global xhigh = "Undecided"
global marginright = "22"
qui do "Three_Way_Interactions.do"



** Issue voter - p < 0.05
*************************

* UK (EP)
import delimited "UK_EP.csv", clear case(preserve)
reg ptv i.treat##c.advice##i.issue_voter if optin_completed == 1, cl(id)
estimates store m5
global model = "m5"
global title = "Issue Voter - UK (EP)"
global x = "issue_voter"
global xlow = "No issue voter"
global xhigh = "Issue voter"
global xlabel = "-100(50)100"
global marginright = "22"
qui do "Three_Way_Interactions.do"
